﻿using SDDP;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DotNetStar.TheKing.Domain
{
    [Table("Tags")]
    public class Tag : IEntity<int>
    {
        [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        [Required,StringLength(150)]
        public string Name { get; set; }
        /// <summary>
        /// 引用次数
        /// </summary>
        public int Count { get;private set; }

        public void IncreaseCount() => this.Count += 1;
        public void DecreaseCount() => this.Count -= 1;
        
    }
}
